<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="format-detection" content="telephone=no">
    #parse("/h5/common/webWords.html")
<link rel="stylesheet" type="text/css" href="http://${staticHost}/css/medioadaption.css">
<link rel="stylesheet" type="text/css" href="http://${staticHost}/css/stcss.css">
<script type="text/javascript" src="http://${staticHost}/js/jquery.js"></script>
<script type="text/javascript" src="http://${staticHost}/js/continuingEducation.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="http://${staticHost}/js/ajaxFileUpload.js"></script>
    <script src="http://${staticHost}/js/layer.js"></script>

    <script type="text/javascript">
        function showMessage(msg){
            layer.open({
                content: msg
                ,btn: '关闭'
            });
        }
    $(document).ready(function(){
    	
    	
        $("#submitForm").click(function(){
        	
        	
        	var sex = $("#sex").val();
        	var nation = $("#nation").val();
        	var marriage = $("#marriage").val();
        	var originPlace = $("#originPlace").val();
        	var homeAddress = $("#homeAddress").val();
        	var workUnit = $("#workUnit").val();
        	var postalCode = $("#postalCode").val();
        	var post = $("#post").val();
        	var postalAddress = $("#postalAddress").val();
        	var preSchoolEducation = $("#preSchoolEducation").val();
        	var politicalOutlook = $("#politicalOutlook").val();
        	var otherContactPhone = $("#otherContactPhone").val();
        	var level = $("#level").val();

        	if(sex == ''){
        		showMessage("性别为必填项");
        		return;
        	}
        	
        	if(nation == ''){
        		showMessage("民族为必填项");
        		return;
        	}
        	
        	if(marriage == ''){
        		showMessage("婚姻状况为必填项");
        		return;
        	}
        	
        	if(originPlace == ''){
        		showMessage("籍贯为必填项");
        		return;
        	}
        	
        	if(homeAddress == ''){
        		showMessage("家庭住址为必填项");
        		return;
        	}
 

            if(level == 1 || level == 2  || level == 3){
                if(workUnit == ''){
                    showMessage("工作单位为必填项");
                    return;
                }

                if(postalCode == ''){
                    showMessage("邮政编码为必填项");
                    return;
                }
                if(post == ''){
                    showMessage("职务为必填项");
                    return;
                }
            }


        	if(postalAddress == ''){
        		showMessage("通讯地址为必填项");
        		return;
        	}
        	
        	if(preSchoolEducation == ''){
        		showMessage("入学前文化程度为必填项");
        		return;
        	}
        	
        	if(politicalOutlook == ''){
        		showMessage("政治面貌为必填项");
        		return;
        	}
        	
        	if(otherContactPhone == ''){
        		showMessage("其他联系方式为必填项");
        		return;
        	}
            showLoading();
        	$.ajax({
                url:"/schoolroll/auth/update", 
                data:$('#myForm').serialize(), // 从表单中获取数据
                type:"POST", 
                error:function(xmlHttpRequest, error) { // 设置表单提交出错
                	console.log(error);
                },
                success:function(resData) {
                	if(resData.status == '00000000'){
                		showMessage("保存成功");
                        window.location.href="/schoolroll/auth/typeIn";	
                	}else{
                		showMessage(resData.message);
                	}
                }
            });
            hideLoading();
        });
    });
    
    function ajaxImageUpload() {
	    var fileName = "";
	    showLoading();
	    var eltFile=document.getElementById("upLoad");//获得文件对象
	    if(eltFile.files[0] == undefined){
	    	hideLoading();
	    	showMessage("请选择要上传的文件!");
	    	return;
	    }
	    var len=eltFile.files[0].size/1024;
	    if(len > 1024){
	    	hideLoading();
	    	showMessage("上传文件超过限制1MB大小,请重新选择");
	    	return;
	    }
	    
		$.ajaxFileUpload({
			url : "/schoolroll/auth/uploadPic",
			dataType : 'json',
			fileElementId : 'upLoad',
			success : function(data, status) {
				if(data.msg=="success"){
					var imgUrl = data.imageUrl;
					var fileName = data.fileName;
					$("#photos").attr('src',imgUrl); 
					$("#electronicPhotos").val(fileName);
					hideLoading();
					showMessage("上传成功,提交后保存");
				}else{
					hideLoading();
					showMessage(data.msg);
				}
			},
			error : function(data, status, e) {
				console.log(e);
				console.log(data);
				hideLoading();
				showMessage("图片上传失败!");
			}
		});
	}

    function addImage(){
    	document.getElementById("upLoad").click();
    }

    //返回选取文件的本地路径
    function imgChange(obj) {
        if($(obj).val()){
            ajaxImageUpload(obj);
        }
    }
    function IsDate() {
    	var birthDate = $("#birthDate").val();
    	if(birthDate == ''){
            return;
        }
    	var reg = /^(\d{4})-(\d{2})-(\d{2})$/;
   		if (!reg.test(birthDate) || RegExp.$2>12||RegExp.$3>31){
   			showMessage("生日格式错误,精确到天.");
   			$("#birthDate").val("");
   			document.getElementById('birthDate').focus();
   			$("#birthDateDiv").css("boreder","1px #000 solid");
   		}
    }
    
    function IsDate1() {
    	var swd = $("#startWorkingDate").val();
    	if(swd == ''){
    		return;
    	}
    	var reg = /^(\d{4})-(\d{2})$/;
   		if (!reg.test(swd) || RegExp.$2>12){
   			showMessage("参加工作的时间格式错误,精确到月!");
   			$("#startWorkingDate").val("");
   			document.getElementById('startWorkingDate').focus();
   		}
    }
    
    function showLoading(){
	    document.getElementById("over").style.display = "block";
	    document.getElementById("layout").style.display = "block";
	}
	
	function hideLoading(){
	    document.getElementById("over").style.display = "none";
	    document.getElementById("layout").style.display = "none";
	}
    
</script>
     <style type="text/css">
    	.editMood{
            color: #333;
        }
         .current a {
             font-size: 20px;
         }
 
         .over {
             display: none;
             position: absolute;
             top: 1300px;
             left: 0;
             width: 100%;
             height: 800px;
             background-color: #f5f5f5;
             opacity:0.5;
             z-index: 1000;
         }

        .layout {
            display: none;
            position: absolute;
            top: 1500px;
            left: 40%;
            width: 20%;
            height: 20%;
            z-index: 1001;
            text-align:center;
        }
    </style>
</head>


<body style="background-color:#f8f8f8;">
<div id="over" class="over"></div>
<div id="layout" class="layout"><img src="http://${staticHost}/images/loading.gif" /></div>
<div class="dlny clear">
   <dl>
      <dt><a href="/edu/auth/toEditHeadprotrait"><img src="${headPortrait}"></a></dt>
      <dd>
          [${studentName}] <a href="/edu/auth/toEditStudentInfo" class="editMood">${mood}</a>
      </dd>
   </dl>
</div>
<input type="hidden" id="level" value="$ssi.level"/>
<div class="login-box">
    <div class="login-box-width">
    	<form id="myForm" action="">
        <ul>
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="studentName" style="width: 94%;" disabled="disabled" value="#if (!$ssi.studentName)#else $ssi.studentName #end" placeholder="姓名">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">身份证真实姓名，如有错误，联系班主任更改</div>
            </li>
            <li class="password-input">
                <div class="form-box clearfix">
                    <select name="sex" id="sex" required="" class="am-field-error am-active" style="background:#ffffff;color: #333;">
		              <option value="">请选择性别</option>
		              <option value="1" #if ($ssi.sex == 1) selected="selected" #end >男</option>
		              <option value="2" #if ($ssi.sex == 2) selected="selected" #end >女</option>
 				 	</select>
                </div>
            </li>
              <li>
                <div class="form-box clearfix" id="birthDateDiv">
                    <input type="text" id="birthDate" name="birthDate" value="#if (!$ssi.birthDate)#else$ssi.birthDate#end" onBlur="IsDate()" placeholder="出生年月">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">请填写xx年xx月xx日，例如1985-07-08</div>
            </li>   
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="nation" name="nation" value="#if (!$ssi.nation)#else$ssi.nation#end" placeholder="民族">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">请填写正确民族</div>
            </li>   
            <li class="password-input">
                <div class="form-box clearfix">
                    <select name="marriage" id="marriage" required="" class="am-field-error am-active" style="background:#ffffff;color: #333;">
		              <option value="">请选择婚姻状况</option>
		              <option value="1" #if ($ssi.marriage == 1) selected="selected" #end >已婚</option>
		              <option value="2" #if ($ssi.marriage == 2) selected="selected" #end >未婚</option>
  					</select>
                </div>
            </li>
            
            <li class="password-input">
                <div class="form-box clearfix">
                    <select name="politicalOutlook" id="politicalOutlook" required="" class="am-field-error am-active" style="background:#ffffff;color: #333;">
		              <option value="">请选择政治面貌</option>
		              #foreach($politicalOutlook in $politicalOutlookList)
						<option value="$politicalOutlook.value" #if ($ssi.politicalOutlook == $politicalOutlook.value) selected="selected" #end >$politicalOutlook.label</option>
					  #end
  				</select>
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">请选择正确政治面貌</div>
            </li>                    
         	<li>
                <div class="form-box clearfix">
                    <input type="text" id="originPlace" name="originPlace" value="#if (!$ssi.originPlace)#else$ssi.originPlace#end" placeholder="籍贯">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">填写x省x市x区/县</div>
            </li>
            
            <li class="password-input">
                <div class="form-box clearfix">
                    <select name="preSchoolEducation" id="preSchoolEducation" required="" class="am-field-error am-active" style="background:#ffffff;color: #333;">
		              <option value="">入学前文化程度</option>
		              #foreach($educationDegree in $educationDegreeList)
                        #if($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3)
                            <option value="$educationDegree.value" #if ($ssi.preSchoolEducation == $educationDegree.value) selected="selected" #end >$educationDegree.label</option>
                        #else
                            #if($educationDegree.value == 1 || $educationDegree.value == 2 || $educationDegree.value == 5 )
                            <option value="$educationDegree.value" #if ($ssi.preSchoolEducation == $educationDegree.value) selected="selected" #end >$educationDegree.label</option>
                            #end
                        #end
					  #end
  					</select>
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">请选择入学前文化程度</div>
            </li>
            <li class="password-input">
                <div class="form-box clearfix">
                    <input type="text" id="idNumber" style="width: 94%;" name="idNumber" value="#if (!$ssi.idNumber)#else$ssi.idNumber#end" placeholder="身份证号" disabled="disabled">
                </div>
                <!--<div style="color:#dc5c5c; padding-left:9px;">务必填写正确的身份证号</div>-->
            </li>
            #if($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3)
            <li class="password-input">
                <div class="form-box clearfix">
                    <select name="learningForm" id="learningForm" disabled="disabled" required="" class="am-field-error am-active" style="background:#ffffff;color: #333;">
		              <option value="">请选择学习形式</option>
		              #foreach($learningForm in $learningFormList)
						<option value="$learningForm.value" #if ($ssi.learningForm == $learningForm.value) selected="selected" #end >$learningForm.label</option>
					  #end
  					</select>
                </div>
            </li>
            #end
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="homeAddress" name="homeAddress" value="#if (!$ssi.homeAddress)#else$ssi.homeAddress#end" placeholder="家庭地址">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">填写身份证上的地址</div>
            </li>
            #if($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3)
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="workUnit" name="workUnit" value="#if (!$ssi.workUnit)#else$ssi.workUnit#end" placeholder="工作单位">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">填写目前所在的工作单位的全称</div>
            </li>
            #end
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="postalCode" name="postalCode" value="#if (!$ssi.postalCode)#else$ssi.postalCode#end" placeholder="邮政编码">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">所在地区的邮编</div>
            </li>
            #if($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3)
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="startWorkingDate" name="startWorkingDate" onBlur="IsDate1()" value="#if (!$ssi.startWorkingDate)#else$ssi.startWorkingDate#end" placeholder="参加工作的时间">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">填写参加工作的时间，例如1990-06</div>
            </li>
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="post" name="post" value="#if (!$ssi.post)#else$ssi.post#end" placeholder="职务">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">目前所在工作岗位的职务</div>
            </li>
            #end
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="mobilePhone" style="width: 94%;" name="mobilePhone" disabled="disabled" value="#if (!$ssi.mobilePhone)#else$ssi.mobilePhone#end" placeholder="手机号">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">手机号码</div>
            </li>
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="otherContactPhone" name="otherContactPhone" value="#if (!$ssi.otherContactPhone)#else$ssi.otherContactPhone#end" placeholder="其他联系电话">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">必填项*</div>
            </li>
            #if($ssi.level == 4 || $ssi.level == 5)
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="collegeGraduateSchool" name="collegeGraduateSchool" value="#if (!$ssi.collegeGraduateSchool)#else$ssi.collegeGraduateSchool#end" placeholder="毕业学校">
                </div>
            </li>
            <li>
                <div class="form-box clearfix">
                    <select name="householdRegistrationNature" id="householdRegistrationNature"  class="am-field-error am-active" style="background:#ffffff;color: #333;">
                        <option value="">请选择户口性质</option>
                        #foreach($householdNature in $householdNatureList)
                        <option value="$householdNature.value" #if ($ssi.householdRegistrationNature == $householdNature.value) selected="selected" #end >$householdNature.label</option>
                        #end
                    </select>
                </div>
            </li>
            #end

            #if($ssi.level == 1 || $ssi.level == 2  || $ssi.level == 3)
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="qqWebchat" name="qqWebchat" value="#if (!$ssi.qqWebchat)#else$ssi.qqWebchat#end" placeholder="QQ/微信">
                </div>
            </li>
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="email" name="email" value="#if (!$ssi.email)#else$ssi.email#end" placeholder="E-mail">
                </div>
            </li>
            #end
            <li>
                <div class="form-box clearfix">
                    <input type="text" id="postalAddress" name="postalAddress" value="#if (!$ssi.postalAddress)#else$ssi.postalAddress#end" placeholder="通讯地址">
                </div>
                <div style="color:#dc5c5c; padding-left:9px;">填写目前所居住的详询的地址</div>
            </li>
            <li>
               <input type="hidden" id="electronicPhotos" name="electronicPhotos" value="" />
               <input type="file" id="upLoad" multiple="true" name="upLoad" style="display:none;" onchange="imgChange(this)"/>
                <div style="width: 100%;display: table;margin-bottom: 5px;">
                    <div style="width: 100%;display: table-cell;vertical-align: middle;">
                        <span><img id="photos" onclick="addImage()" #if (!$ssi.electronicPhotos || "$ssi.electronicPhotos" == "") src="http://${staticHost}/images/simple1.png" #else src="$imageHost$ssi.electronicPhotos" #end default="#if (!$ssi.electronicPhotos || "$ssi.electronicPhotos" == "")http://${staticHost}/images/simple1.png#else$imageHost$ssi.electronicPhotos"#end" /></span>
                    </div>
                </div>
               <dd style="line-height:21px; margin-top:8px;">上传您的照片分以下步骤1:点示例图片选择您的图片。2:选择前请仔细核对下方照片要求，不得上传不合乎规定图片</dd>
               <dd style="line-height:21px; margin-top:8px;">上传规格：照片必须为浅蓝色背景，大小480*640，像素大于30kb，小于1mb，照片禁止用手机自拍或PS，务必去照相馆照好。</dd>
            </li>
        </ul>
        </form>
    </div>
    <div class="md_dl"><input name="" id="submitForm" type="image" src="http://${staticHost}/images/tj01.jpg" style="width:290px; height:42px; border:none; margin-top:20px; margin-bottom:30px;" /></div>
</div>

<div class="holderdiv"></div>
<div class="fixdiv">
  <ul>               
    <li>
    	#if($ssi.universityFillStatus == 1 && $ssi.baseInfoFillStatus == 1 && $ssi.workExperienceFillStatus == 1 && $ssi.familyFillStatus == 1)
    		<a href="/internal/auth/myClass">
    	#else
    		<a href="javascript:void(0)" onclick="window.history.go(-1)">
    	#end
    	<img src="http://${staticHost}/images/foticon001.jpg"><span>返回</span></a></li>
    <li><a href="/edu/auth/modifyPwd"><img src="http://${staticHost}/images/foticon004.jpg"><span>重置密码</span></a></li>
	<li><a href="javascript:void(0)" onclick="loginOut()"><img src="http://${staticHost}/images/foticon003.jpg"><span>退出系统</span></a></li>
  </ul>
</div>

</body>
</html>